﻿using System;
using System.Xml;
using Notoric.Model.Internal;
using Notoric.Model.Packaging;

namespace Notoric.Model.Elements.CWNotation
{
    /// <summary>
    /// Represents a dynamic mark.
    /// </summary>
    public class DynamicMark : PresentedAttachment
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="DynamicMark"/> class.
        /// </summary>
        /// <param name="packagePart">
        /// <para>
        /// Type: <see cref="XmlPackagePart"/>
        /// </para>
        /// <para>
        /// The package part that owns this mark.
        /// </para>
        /// </param>
        /// <param name="owner">
        /// <para>
        /// Type: <see cref="Staff"/>
        /// </para>
        /// <para>
        /// The staff that directly owns this mark.
        /// </para>
        /// </param>
        /// <param name="presentedMark">
        /// <para>
        /// Type: <see cref="DynamicMarkElement"/>
        /// </para>
        /// <para>
        /// The presented mark element.
        /// </para>
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// Any of the arguments is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentException">
        /// The <paramref name="presentedMark"/> does not belong to the same part as the <paramref name="owner"/>.
        /// </exception>
        internal DynamicMark(XmlPackagePart packagePart, Staff owner, DynamicMarkElement presentedMark)
            : base(packagePart, owner, presentedMark)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DynamicMark"/> class.
        /// </summary>
        /// <param name="packagePart">
        /// <para>
        /// Type: <see cref="XmlPackagePart"/>
        /// </para>
        /// <para>
        /// The package part that owns this mark.
        /// </para>
        /// </param>
        /// <param name="owner">
        /// <para>
        /// Type: <see cref="Staff"/>
        /// </para>
        /// <para>
        /// The staff that directly owns this mark.
        /// </para>
        /// </param>
        /// <param name="element">
        /// <para>
        /// Type: <see cref="XmlElement"/>
        /// </para>
        /// <para>
        /// The XML element that holds the data of this mark.
        /// </para>
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// Any of the arguments is <see langword="null"/>.
        /// </exception>
        internal DynamicMark(XmlPackagePart packagePart, Staff owner, XmlElement element)
            : base(packagePart, owner, element)
        {

        }

        #endregion

        #region Attachment Members

        /// <inheritdoc/>
        protected override XmlElement CreateSymbolElement(XmlDocument document)
        {
            return document.CreateElement(
                PackageVocabulary.PackageNamespacePrefix,
                PackageVocabulary.DynamicMarkElementName,
                PackageVocabulary.PackageNamespaceUri
                );
        }

        #endregion
    }
}
